package com.xckj.cycling.viewmodel

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.junca.android.service.Request
import kotlinx.coroutines.launch

/**
 * 负责将推送token上报服务器
 */
class PushViewModel : ViewModel() {
    fun uploadToken(result: String?) {
        result ?: return
        viewModelScope.launch {
            val r = Request.postSuspend<Any>(
                "qixing/user/uploadpushtoken",
                HashMap<String, Any>().apply {
                    put("android_token", result)
                })
        }
    }
}